class Dictionary {
    constructor() {
        this.items = {};
    }

    // has
    has(value) {
        return value in this.items;
    }

    // set
    set(key, value) {
        this.items[key] = value;
    }

    // remove
    remove(key) {
        if (this.has(key)) {
            Reflect.deleteProperty(this.items, key);
        }
    }

    // get
    get(key) {
        return this.has(key) ? this.items[key] : undefined;
    }

    // values
    values() {
        let values = [];
        for (const key in this.items) {
            if (this.has(key)) {
                values.push(this.items[key]);
            }
        }
        return values;
    }

    // clear
    clear() {
        this.items = {};
    }

    // size
    size() {
        return Reflect.ownKeys(this.items).length;
    }

    // keys
    keys() {
        return Reflect.ownKeys(this.items);
    }

    // getItems
    getItems() {
        return items;
    }
}